<?php

use common\models\member\Level;
use yii\db\Migration;

/**
 * Class m220104_030225_add_col_member_level
 */
class m220104_030225_add_col_member_level extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn(Level::tableName(),'daily_tasks',$this->integer(6));
        $this->addColumn(Level::tableName(),'daily_profit',$this->money(10,2));
        $this->addColumn(Level::tableName(),'pre_order',$this->money(10,2));
        $this->addColumn(Level::tableName(),'monthly_inconme',$this->money(10,2));
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropColumn(Level::tableName(), 'daily_tasks');
        $this->dropColumn(Level::tableName(), 'daily_profit');
        $this->dropColumn(Level::tableName(), 'pre_order');
        $this->dropColumn(Level::tableName(), 'monthly_inconme');
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m220104_030225_add_col_member_level cannot be reverted.\n";

        return false;
    }
    */
}
